import { UserType } from './../store/reducer/user';
import request from '@/utils/request';

export const getUserProfileAPI = () => {
  return request({ url: '/v1_0/user' });
};

export const getUserAPI = () => {
  return request({ url: '/v1_0/user/profile' });
};

export const updatePhotoAPI = (formData: FormData) => {
  return request({
    url: '/v1_0/user/photo',
    method: 'patch',
    data: formData,
  });
};

export const updateUserAPI = (data: Partial<UserType>) => {
  return request({
    url: '/v1_0/user/profile',
    method: 'patch',
    data: data,
  });
};
